struct Employee {
    name : String,
    company: String,
    age : u32,
}

impl Employee {
    fn new(name : String, company: String, age : u32) -> Employee {
        Employee {
            company :company,
            name : name,
            age : age,
        }
    }
    fn print(&self) {
        println!("impl Employee name:{} company:{} age:{}", self.name, self.company, self.age);
    }
}
fn main() {
    /*

    let e1 = Employee {
        company:String::from("MSFT"),
        name:String::from("name1"),
        age:20,
    };
    display(&e1);

    println!("Employee name: {}", e1.name);
     */
    let e = Employee::new("James".into(), "MSFT".into(), 42);
    e.print();
}

fn display( emp : &Employee) {
    println!("{} is {} years old, company is {}", emp.name, emp.age, emp.company);
}
